﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Minimalized
{
    class MainMenu
    {
        #region Fields
        private static Texture2D backgroundTexture = Texture_Library.MainMenu_backgroundTexture;
        
        private static Texture2D button1_texture1 = Texture_Library.button1_texture1;
        private static Texture2D button1_texture2 = Texture_Library.button1_texture2;

        private static Texture2D button2_texture1 = Texture_Library.button2_texture1;
        //private static Texture2D button1_texture2 = Texture_Library.button1_texture2;

        private static Texture2D button3_texture1 = Texture_Library.button3_texture1;
        //private static Texture2D button1_texture2 = Texture_Library.button1_texture2;


        private Rectangle background_rect;

        private Rectangle button_start_rect;
        private Rectangle button_credits_rect;
        private Rectangle button_exit_rect;
        #endregion
        #region Methods
        
        public MainMenu()
        {
            background_rect = new Rectangle(0, 0, 800, 600);
            button_start_rect = new Rectangle(50, 250, 200, 70);
            button_credits_rect = new Rectangle(50, 300, 160, 50);
            button_exit_rect = new Rectangle(20, 335, 160, 50);
        }
        public void Update()
        {
        }
        public bool StartGame()
        {
            if ((button_start_rect.Contains(Mouse.GetState().X, Mouse.GetState().Y)) && (Mouse.GetState().LeftButton == ButtonState.Pressed))
                return true;
            else
                return false;
        }
        public void Draw(SpriteBatch spritebatch)
        {
            spritebatch.Begin();
            spritebatch.Draw(backgroundTexture, background_rect, Color.White);
            if (button_start_rect.Contains(Mouse.GetState().X, Mouse.GetState().Y))
                spritebatch.Draw(button1_texture2, button_start_rect, Color.White);
            else
                spritebatch.Draw(button1_texture1, button_start_rect, Color.White);
            spritebatch.Draw(button2_texture1, button_credits_rect, Color.White);
            spritebatch.Draw(button3_texture1, button_exit_rect, Color.White);
            spritebatch.End();
        }
        #endregion
    }
}
